/*
Created on Sept. 28th 2005
(C) 2005 
@author Michael J Ocean

This program is free software; you can redistribute it and/or
modify it under the terms of Version 2 of the GNU General Public 
License.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

package sxe.sensors;

import snbenchlib.Util;
import snobject.snObject;
import snobject.snString;


public class ClockSensor extends GenericSensor {

	
	private void doConstructor(){
		m_state = GenericSensor.STATE_PREINIT;
		m_type = GenericSensor.TYPE_CLOCK;
		m_uri = m_type + "/" + m_id;
	}
	
	public ClockSensor() {
		super();
		doConstructor();
	}
	
	public String GetInfoXML(){
		String b = new String();
		b+="<name>default clock</name>";
		return super.GetInfoXML(b);
	}
	
	public boolean initializeSensor() {
		    m_state = STATE_INIT;
		    return true;	
	}


	public boolean isAlive() {
		return true;
	}

	public snObject getData(Object oParam) {
		return new snString(Util.currentTime());

	}

	public boolean shutDown() {
		m_state = GenericSensor.STATE_PREINIT;
		return true;
	}
}

